<template>
    <svg
        ref="icon"
        class="icon"
        :style="iconstyle"
        aria-hidden="true">
        <use :xlink:href="'#icon-wp-' + name"></use>
    </svg>
</template>

<script>
export default {
    props: {
        // 图标名
        name: String,
        // 图标颜色 仅限单色图标
        color: String,
        // 图标大小
        size: {
            type: String,
            default: '14'
        }
    },
    computed: {
        iconstyle () {
            return {
                fontSize: this.size + 'px',
                color: this.color
            };
        }
    }
};
</script>

<style>

</style>
